---
category: Math
created: '2021-05-24'
title: Normalize the ratio of a number in a range
updated: '2021-10-13'
---

**JavaScript version**

```js normalizeRatio.js
const normalizeRatio = (value, min, max) => (value - min) / (max - min);
```

**TypeScript version**

```ts normalizeRatio.ts
const normalizeRatio = (value: number, min: number, max: number): number => (value - min) / (max - min);
```

## See also

-   [Calculate the linear interpolation between two numbers](https://phuoc.ng/collection/1-loc/calculate-the-linear-interpolation-between-two-numbers/)
-   [Linear scale of a number between two ranges](https://phuoc.ng/collection/1-loc/linear-scale-of-a-number-between-two-ranges/)
